<?php
/**
 *      [Elitechmedia!] (C)2001-2099 MYSELF Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: iphone_json.php 22609 2013-10-16 01:55:33Z zhangchaofeng
 */
header('Content-type: text/json');
include_once("../classes/DB.class.php");
include_once("../classes/page.class.php");
include_once("../function/member.php");
include_once("../function/util.func.php");
date_default_timezone_set('Asia/Shanghai');
$mod=$_REQUEST['mod'];
$c_id=addslashes($_REQUEST['cid']);
if($mod=='parts'):
$data = $GLOBALS["DB"]->result("SELECT * FROM parts where 1=1 ORDER BY id DESC ");
elseif($mod=='process'):
$data = $GLOBALS["DB"]->result("SELECT * FROM process where c_id='$c_id' ORDER BY id DESC ");
elseif($mod=='production'):
$data = $GLOBALS["DB"]->result("SELECT * FROM production where c_id='$c_id' ORDER BY id DESC ");
elseif($mod=='get_name'):
$uid=addslashes($_REQUEST['uid']);
$info= $GLOBALS["DB"]->result("SELECT name,type FROM employee where c_id='$c_id' and uid='$uid' ORDER BY uid DESC ");
$data['name']=$info[0]['name'];
if($info[0]['type']==1):
$type="普通员工";
elseif($info[0]['type']==2):
$type="验收员";
endif;
$data['type']=$type;
endif;
echo json_encode($data);


